package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PostMapping;

import java.time.LocalDateTime;

@Mapper
public interface UserMapper {

    /**
     * 查询是否有指定id的用户
     * @param openid
     * @return
     */
    User getByOpenId(@Param("openid") String openid);

    /**
     * 新增用户
     * @param user
     */
    void insertUser(@Param("user") User user);

    /**
     * 获取用户数量
     * @param beginTime
     * @param endTime
     * @return
     */
    Integer getCountByDate(@Param("begin") LocalDateTime beginTime,@Param("end") LocalDateTime endTime);
}
